package cn.tedu.spring.config;

import cn.tedu.spring.bean.UserService;
import cn.tedu.spring.file.Dataase;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 测试类
 */
public class TestSpringConfig {
    public static void main(String[] args) {
        ApplicationContext context=new AnnotationConfigApplicationContext(SpringConfig.class);
        //获取UserService
        UserService userService=context.getBean(UserService.class);
        System.out.println(userService);

        //获取Databse
        Dataase dataase = context.getBean(Dataase.class);
        System.out.println(dataase);

    }
}
